﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ASPNET.StarterKit.BusinessLogicLayer;
using ASPNET.StarterKit.DataAccessLayer;



public partial class InventoryTracker_CustomerMaster : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    


    protected void btnCustSubmit_Click(object sender, EventArgs e)
    {
        DataAccess DA = DataAccessHelper.GetDataAccess();
        Customer aCustomer = new Customer(txtCustName.Text,txtCustAddr1ID.Text,txtCustAddr2ID.Text,txtCustAddr3ID.Text,
            txtCustCity.Text,txtCustState.Text,txtCustCountry.Text,txtCustPhone.Text,txtCustMobile.Text,txtCustFax.Text,
            txtCustEMail.Text,txtCustZipCode.Text,txtCustLeadTime.Text,txtCustStatus.Text);
        try
        {
            if (DA.CreateCustomer(aCustomer))
            {
                lblResult.Text = "SUCCESS";
            }
            else
            {
                lblResult.Text = "FAILURE";
            }
        }
        catch (Exception ex)
        {
            lblResult.Text = ex.Message.ToString();
        }


    }
}
